package liumengbaio.lolzhangyoubao.Activity.Activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.squareup.picasso.Picasso;

import liumengbaio.lolzhangyoubao.R;

/**
 * 装备详情页面
 * Created by lanouhn on 16/9/19.
 */
public class MoreEquipDetailsActivity extends AppCompatActivity {

    private ImageView pic, back;
    private TextView name, price, content;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.more_equip_details);
        initView();
        initData();
        initEvent();
    }

    private void initView() {
        pic = (ImageView) findViewById(R.id.pic);
        name = (TextView) findViewById(R.id.name);
        price = (TextView) findViewById(R.id.price);
        content = (TextView) findViewById(R.id.content);
        back = (ImageView) findViewById(R.id.more_recreation_back);
    }

    private void initData() {
        Intent intent = getIntent();
        Picasso.with(this).load(intent.getStringExtra("icon")).into(pic);
        name.setText(intent.getStringExtra("title"));
        price.setText("总价：" + intent.getStringExtra("price"));
        content.setText(intent.getStringExtra("content"));
    }

    private void initEvent() {
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}
